using System;
using System.Collections.Generic;
using System.Text;
using BusinessObjects.BO_Actions.HelpDetail;
using Entity.StoreProcedure;
using BusinessObjects;
using System.Data;
using BusinessObjects;
namespace BusinessObjects.BO_GetObjects
{
    public static class BO_HelpDetail
    {

        public static DataTable Search(int help_id)
        {
            try
            {
                BOHelpDetail_Search action = new BOHelpDetail_Search();
                usp_HelpDetail_Search entity = new usp_HelpDetail_Search();
                entity.HELP_ID = help_id;
                return action.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static DataTable SearchByCategory(int category_id)
        {
            try
            {
                BOHelpDetail_Search_By_Category action = new BOHelpDetail_Search_By_Category();
                usp_HelpDetail_Search_By_Category entity = new usp_HelpDetail_Search_By_Category();
                entity.CATEGORY_ID = category_id;
                return action.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static string Insert(int category_id, string help_detail, DateTime created_date, string created_by, DateTime modify_date, string modify_by, bool status)
        {
            try
            {
                BOHelpDetail_Insert action = new BOHelpDetail_Insert();
                usp_HelpDetail_Insert entity = new usp_HelpDetail_Insert();
                entity.CATEGORY_ID = category_id;
                entity.HELP_DETAILS = help_detail;
                entity.CREATED_DATE = created_date;
                entity.CREATED_BY = created_by;
                entity.MODIFY_DATE = modify_date;
                entity.MODIFY_BY = modify_by;
                entity.STATUS = status;

                return action.ExecuteAndReturnStringValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static string Update(int help_id, int category_id, string help_detail, DateTime created_date, string created_by, DateTime modify_date, string modify_by, bool status)
        {
            try
            {
                BOHelpDetail_Update action = new BOHelpDetail_Update();
                usp_HelpDetail_Update entity = new usp_HelpDetail_Update();
                entity.CATEGORY_ID = category_id;
                entity.HELP_ID = help_id;
                entity.HELP_DETAILS = help_detail;
                entity.CREATED_DATE = created_date;
                entity.CREATED_BY = created_by;
                entity.MODIFY_DATE = modify_date;
                entity.MODIFY_BY = modify_by;
                entity.STATUS = status;

                return action.ExecuteAndReturnStringValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static bool Delete(int help_id)
        {
            try
            {
                BOHelpDetail_Delete action = new BOHelpDetail_Delete();
                usp_HelpDetail_Delete entity = new usp_HelpDetail_Delete();
                entity.HELP_ID = help_id;

                return action.ExecuteAndReturnBooleanValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}

